/*
 * @Description: 浪潮导出机票订单
 * @Version: 2.0
 * @Autor: 许国辉
 * @Date: 2023-05-19 08:24:06
 * @LastEditors: 许国辉
 * @LastEditTime: 2023-11-09 07:16:51
 */
import { BasicColumn } from '/@/components/Table';
import dayjs from 'dayjs';
export const comprehensiveSubsidyColumns: BasicColumn[] = [
  //1
  {
    title: '审批单号',
    dataIndex: 'a0',
    width: 160,
    customRender({ record }) {
      return record.requestCode;
    },
  },
  {
    title: '单位编号',
    dataIndex: 'a1',
    width: 80,
    customRender({ record }) {
      return record.unitId;
    },
  },
  {
    title: '部门编号',
    dataIndex: 'a2',
    width: 80,
    customRender({ record }) {
      return record.departmentId;
    },
  },
  {
    title: '职工编号',
    dataIndex: 'a3',
    width: 80,
    customRender({ record }) {
      return record.employeeNo;
    },
  },
  {
    title: '职工姓名',
    dataIndex: 'a4',
    width: 80,
    customRender({ record }) {
      return record.employeeName;
    },
  },
  {
    title: '目的地',
    dataIndex: 'a5',
    width: 80,
    ellipsis: true,
    customRender({ record }) {
      return record.destination ? record.destination : '-';
    },
  },
  {
    title: '出发日期',
    dataIndex: 'a6',
    width: 105,
    customRender({ record }) {
      return dayjs(record.dateOfDeparture).format('YYYY-MM-DD');
    },
  },
  {
    title: '返程日期',
    dataIndex: 'a7',
    width: 105,
    customRender({ record }) {
      return dayjs(record.dateOfReturn).format('YYYY-MM-DD');
    },
  },
  {
    title: '到期日期',
    dataIndex: 'a8',
    width: 105,
    customRender({ record }) {
      return dayjs(record.dateOfReturnProlong).format('YYYY-MM-DD');
    },
  },
  {
    title: '交通工具',
    dataIndex: 'a9',
    width: 110,
    customRender({ record }) {
      return record.vehicle;
    },
  },
  {
    title: '用餐天数',
    dataIndex: 'a10',
    width: 80,
    customRender({ record }) {
      return record.empExpensesDetail ? record.empExpensesDetail.countMeals : '0';
    },
  },
  {
    title: '伙食费补助',
    dataIndex: 'a11',
    width: 100,
    customRender({ record }) {
      return record.empExpensesDetail ? record.empExpensesDetail.moneyMeals : '0';
    },
  },
  {
    title: '用车天数',
    dataIndex: 'a12',
    width: 80,
    customRender({ record }) {
      return record.empExpensesDetail ? record.empExpensesDetail.countCar : '0';
    },
  },
  {
    title: '市内交通费补助',
    dataIndex: 'a13',
    width: 140,
    customRender({ record }) {
      return record.empExpensesDetail ? record.empExpensesDetail.moneyCar : '0';
    },
  },
  {
    title: '合计金额',
    dataIndex: 'a14',
    width: 80,
    customRender({ record }) {
      return record.empExpensesDetail
        ? record.empExpensesDetail.moneyMeals + record.empExpensesDetail.moneyCar
        : '0';
    },
  },
];
